QuickTime 4 API Documentation

Inside Macintosh: QuickTime

Previous | Overview | Contents | Next |

Spooling Compressed Data

During compression and decompression operations it may be necessary to spool the image data to or from storage other than computer memory. If your application uses the Image Compression Manager functions that handle picture files, the Image Compression Manager manages this spooling for you. However, if you use the functions that work with pixel maps or sequences and your application cannot store the image data in memory, it is your application's responsibility to spool the data.

The Image Compression Manager provides a mechanism that allows the compressors and decompressors to invoke spooling functions provided by your application. There are two kinds of data-spooling functions: data-loading functions and data-unloading functions. Decompressors call data-loading functions during image decompression. The data-loading function is responsible for providing compressed image data to the decompressor. The decompressor then decompresses the data and writes the resulting image to the appropriate location. See "Application-Defined Functions," for a detailed description of the calling sequence used by the decompressor component when it invokes your data-loading function.

Compressors call data-unloading functions during image compression. The data-unloading function must remove the compressed image data from memory. The compressor can then compress more of the image and write the compressed image data into the available buffer space. See "Application-Defined Functions," for a detailed description of the calling sequence used by the compressor component when it invokes your data-unloading function.

When compressing sequences, your application assigns a data-unloading function by calling the SetCSequenceFlushProc function (described on SetCSequenceFlushProc ). When decompressing sequences, you assign a data-loading function by calling the SetDSequenceDataProc function (described on SetDSequenceDataProc ).

When your application assigns a spooling function to an image or sequence operation, you must also specify a data buffer and the size of that buffer. The codecMinimumDataSize value specifies the smallest data buffer you may allocate for image data spooling.

#define codecMinimumDataSize 32768                  /* minimum data size */

© 1999 Apple Computer, Inc.

Previous | Overview | Contents | Next